<!--left-->
<div class="left appSidebar">
	<div class="appBoxT" id="appList">
		<div class="appBoxB">
			<div class="appBox">
				<div class="appBoxbg">
				  <div class="userInfo">
						<div class="avatarImg">
							<a href="<?=get_user_home_url($this->user_id)?>">
								<img src="<?=$this->pbdata['avatar_l']?>" />
							</a>
						</div>
						<div class="userAvatarR">
							<h2><a href="<?=get_user_home_url($this->user_id)?>"><?if(!empty($this->pbdata['user_name'])) echo utf_substr($this->pbdata['user_name'], 10 ,false); else echo '您的昵称';?></a></h2>
							<p class="pd10"><a href="<?=get_user_home_url($this->user_id)?>" class="txt3">预览我的主页</a>
							<br />
							<a href="<?=UCLibPageBuilder::createUrl('user/profile', array('act' => 'view', 'to' => 2))?>" class="txt3">上传头像</a>
							</p>
					  </div>
					   <?if(is_array($this->pbdata['medal_list'])):?>
					   <div id="medal_list" class="pd5"><?foreach($this->pbdata['medal_list'] as $k=>$v):?><a cont="<?php echo $k.'|'.$v['name'].'|'.$v['time'].'|'.$v['type_name'].'|'.$v['desc'].'|'.$v['medal_status'].'|'.$v['img'].'|'.$v['url'].'|'.$v['next'].'|'.$v['modify_time'];?>" href="javascript:void(0)" title="<?php echo $v['name'];?>：<?php echo $v['m_desc'];?>" flag="my" id="medal_<?=$k?>"><img src="<?php if(UCConfMedal::MEDAL_USER_STATUS_DONEANDHAVE!=$v['medal_status']){$medal_type='d';}else{$medal_type='s';}echo UCModMedalInterface::getMedalAvatar($v['img'],$medal_type);?>" /></a><?endforeach;?></div>	
					   <?endif;?>
						<div class="clear"></div>
					</div>
					<!--app-->
						<?
						$i = 1;
						foreach($app_list as $key => $app)
						{
							$page = ceil($i / $page_size);
							if($i == (($page - 1) * $page_size + 1)) {
								echo '<div class="app" id="appbarpage' . ($page - 1) . '" style="min-height:480px;_height:480px;display:none;">';
							}
							
							echo '<a appid="' . $app['id'] . '" ' . UCModPanel::getLink($app) . '><img src="' . $app['icon'] . '" alt="' . htmlspecialchars($app['title']) . '" width="50" height="50" /><br />' . subStrCh($app['title'],8,false) . '</a>';
							
							if($i == $page * $page_size || $i == count($app_list)) {
								echo '</div>';
							}
							$i++;
						}?>
						<div class="clear"></div>
						
				  <!--/app-->
				  <?php //if($total_page > 1): ?>
				  <!--分页-->
				  <div class="leftPage">
					<a href="javascript:void(0);" onclick="prevpage();" class="pre"></a>
					<span id="appcpndiv">1</span>
					<span>/</span>
					<span><?echo $total_page ?></span>
					<a href="javascript:void(0);" onclick="nextpage();" class="next"></a>
				  </div>
				  <!--/分页-->
				   <?php //endif;?>
				  <div class="topFive">
					<a href="/relation"><img src="<?=__STATIC_URL?>/images/apps/relation.png" width="32" height="32" /><br />好友</a>
					<a href="/message"><img src="<?=__STATIC_URL?>/images/apps/message.png" width="32" height="32" /><br />信箱</a>
					<a href="/medal"><img src="<?=__STATIC_URL?>/images/apps/medals.png" width="32" height="32" /><br />勋章</a>
					<a href="/user/profile/?act=view"><img src="<?=__STATIC_URL?>/images/apps/settings.png" width="32" height="32" /><br />设置</a>
					<a href="/store/account"><img src="<?=__STATIC_URL?>/images/apps/account.png" width="32" height="32" /><br />通行证</a>
					<div class="clear"></div>
				  </div>
            	</div>
			</div>
		</div>
	</div>
</div>
 <!--ding test-->
<script type="text/javascript">
$('#medal_list a').click(snda.uclib.page.medal.index.clickPop);
var tpn = <?echo $total_page?>;
var cpn = parseInt($.cookie('apppagenum'));
cpn = (!cpn || cpn <0 || cpn > tpn - 1) ? 0 : cpn;
updatepagediv();
//设置当前页显示
$("#appbarpage"+cpn).css("display","block");
function prevpage()
{
	if(cpn>0){
		$.cookie('apppagenum',cpn-1);
		$("#appbarpage"+cpn).animate( { opacity:'hide' }, { queue:false, duration:0 } );
		$("#appbarpage"+(cpn-1)).animate( { opacity:'show' }, { queue:false, duration:0 } );
		cpn=cpn-1;
		updatepagediv();
	}
}
function nextpage(){
	if(cpn<(tpn-1)){
		$.cookie('apppagenum',cpn+1);
		$("#appbarpage"+cpn).animate( { opacity:'hide' }, { queue:false, duration:0 } );		
		$("#appbarpage"+(cpn+1)).animate( { opacity:'show' }, { queue:false, duration:0 } );
		cpn=cpn+1;
		updatepagediv();
	}
}
function updatepagediv(){
	$("#appcpndiv").html(cpn+1);
}
$('#appList').pngFix();
</script>
<!--/left-->